#include <stdio.h>
int pip[2]; /* descripteur de pipe */
char buf[6];

main() {
    pipe(pip); /* creationpipe */
    switch(fork()) {
      case -1: perror("pipe"); exit(1);

      case 0: fils();

      default:pere();

    }
}

    pere(){
       read(0,buf,5);
       write(pip[1],buf,5);
       //write(1,"hello\n",5); 
       exit(0);
    }

/* écriture pipe */
    fils() {
        read(pip[0],kbuf,5);
        //read(0,buf,5);
        printf("Sortie %s\n",buf);
        exit(0);
     }/* lecture pipe */

